<meta charset="UTF-8">
<style>
input[name]{
    width:70px;
    text-align:center;
}
</style>
<input value="春" name="season" />
<input value="夏" name="season" />
<input value="秋" name="season" />
<input value="冬" name="season" />
<input id="btn" type="button" value="显示季节名称" />
<br />
<p id="p1"></p>
<script>
btn.onclick = function(){
    var seasons = document.getElementsByName("season");
    var s = "";
    for(var i=0;i<seasons.length;i++) {
        s = s + seasons[i].value;
    }
    p1.innerHTML = s;
};
</script>
